<?php
defined('SYSPATH') OR die('No direct access allowed.');
/**
 * typechart.php
 * @author ranuandra
 *
 * 24 Agu 2011 11:40:11
 *
 * 
 */
include_once Kohana::find_file('vendor', 'Fushion/FusionCharts.php',  array(), array());
$strXml = "";
$strXml .= "<chart caption='PENJUALAN KENDARAAN' showPercentValues='1' pieSliceDepth='30' showBorder='0'>";

if(isset($datas))
{
	foreach($datas as $data)
	{
		$type = ORM::factory('type')->where('id', '=', $data['type_id'])->find();
		//print_r($type);
		$strXml .= "<set label='".$type->type."(".$type->merk->merk.")' value='".$data['jumlah']."'  />";
	}
}
$strXml .= "</chart>";

if(isset($header))
{
	echo $header;
}
?>
<div class="tbldata" align="center">
<div id="chartdiv" align="center"> 
<?php 
  echo renderChartHTML(URL::base()."assets/charts/Pie3D.swf", "", $strXml, "myNext", 900, 300, false);
?>
</div>
</div>